package com.unsiv.snake;

import java.io.IOException;
import java.io.InputStream;

import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.RelativeLayout;

import com.google.ads.AdRequest;
import com.google.ads.AdView;

/**
 * <p></p>
 * @author fanzhen
 * @time   4:37:35 PM Oct 28, 2011
 * @email  fanzhen.meng@gmail.com
 * @qq     474146502
 * @phone  13953109657
 */
public class InitActivity extends Activity{
	private AdView adView;
	private RelativeLayout rl;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.init);
		Resources r = getResources();
		try {
			InputStream is = r.getAssets().open("gfx/snake_background.png");
			rl = (RelativeLayout)findViewById(R.id.rl);
			rl.setBackgroundDrawable(Drawable.createFromStream(is, "gfx"));
		} catch (IOException e) {
			e.printStackTrace();
		}
		adView = (AdView) findViewById(R.id.adView);
		adView.loadAd(new AdRequest());
	}
}
